using System;
using System.Collections.Generic;
using System.Text;

namespace CodePlex.Resourceful.Amazon.S3
{

#if SILVERLIGHT
    public class S3Exception : CodePlexException
    {
#else
        [Serializable]
    public class S3Exception : CodePlexException
    {
        protected S3Exception(
                System.Runtime.Serialization.SerializationInfo info,
                System.Runtime.Serialization.StreamingContext context)
            : base(info, context) { }
#endif


        public S3Exception() { }
        public S3Exception(string message) : base(message) { }
        public S3Exception(string message, Exception inner) : base(message, inner) { }
      


        public static new S3Exception Format(string message, params object[] args)
        {
            return new S3Exception(string.Format(message, args));
        }

        public static new S3Exception Format(Exception inner, string message, params object[] args)
        {
            return new S3Exception(string.Format(message, args), inner);
        }


        public static S3Exception Format(NameValuePairs fields, string message, params object[] args)
        {
            S3Exception rt = new S3Exception(string.Format(message, args));
            rt._fields = fields;
            return rt;
        }

        public static S3Exception Format(NameValuePairs fields, Exception inner, string message, params object[] args)
        {
            S3Exception rt = new S3Exception(string.Format(message, args), inner);
            rt._fields = fields;

            return rt;
        }

        private NameValuePairs _fields;
        public NameValuePairs Fields
        {
            get
            {
                return _fields;
            }
        }
    }
}
